home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: jlilley@ix.netcom.com (John Lilley)
- Newsgroups: comp.lang.c++
- Subject: Re: Automatic Data Segm exceeds 64 K
- Date: 15 Mar 1996 02:37:08 GMT
- Organization: Netcom
- Message-ID: <4ial4k$3s0@ixnews3.ix.netcom.com>
- References: <juanjose.74.002CFB27@melbpc.org.au>
- NNTP-Posting-Host: den-co10-19.ix.netcom.com
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-NETCOM-Date: Thu Mar 14 6:37:08 PM PST 1996
- Keywords: C++ segment problems
- X-Newsreader: WinVN 0.99.7
-
- In article <juanjose.74.002CFB27@melbpc.org.au>, juanjose@melbpc.org.au
- says...
- >
- >hI!
- >If you have a solution for this problem, please send me a few lines with
- >indications. I am not a C programmer, and in a program I am having errors
- >like:"Linker Error: Automatic data segment exceeds 64K" or some times "A1
- >overlaps ... DGROUP ..."
- >I am using Borland C++ v3.5 as compiler...
- >
- >I sumarize the problem, in the next 2 samples of code.. They are just a
- summary extracted from the DLL source, (without the LibMain & WEP an
- >
- >Sample of SOURCE FILE MYINCLUDE.H:
- >----------------------------------
- > ......
- > extern "C" int FAR PASCAL _export allocmem (void);
- > extern "C" int FAR PASCAL _export movmem(void);
- >
- > HANDLE hptr[500]; //hndl to allocmem
- > char far *ttt[500]; //pointer to allocated memory
- > .....
-
- I am dubious about putting data declarations in a header file, because
- that may create a separate copy of the data in each module that includes
- the header...
-
- Other than that, try two things:
- 1) Change the above code to
- HANDLE far hptr[500]; //hndl to allocmem
- char far * far ttt[500]; //pointer to allocated memory
- The extra 'far' causes allocation in another segment.
-
- 2) Set the 'far data threshold' to a small value like 256. I don't
- know how this is done in Borland C++ 3.5. In 4.5 it is under
- Options/Project/16-bit Compiler.
-
- john lilley
-
-